import { axios } from "@/utils/request.ts";

export interface ResPage<T> {
  total: number;
  rows: T[];
  code: number;
  msg: string;
  data: T[];
}
export interface Param {
  key: string;
  value: string;
}
export interface Search {
  keywords?: string;
  pageNum?: number;
  pageSize?: number;
  total?: number;
  [key: string]: unknown;
}

export function fetchLoadData(
  params: Search,
  url: string,
): Promise<ResPage<unknown>> {
  return axios({
    url,
    params,
    method: "get",
  });
}
